/**
 * 
 */
package com.alkandros.linesmash.ui.signup;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.alkandros.linesmash.R;
import com.alkandros.linesmash.location.ILocationCallBack;
import com.alkandros.linesmash.ui.ActionSelection;
import com.alkandros.linesmash.ui.BaseActivity;
import com.alkandros.linesmash.ui.OrderReceipt;

/**
 * @author Jiju Induchoodan
 *
 */
public class PaymentDetailsCreditCard  extends BaseActivity implements OnClickListener,ILocationCallBack{

	private Intent intent;
	private TextView submit;
	private Bundle extras;
	private boolean isCheckoutMode=false;
	@Override
	public void onClick(View v)
	{
		if(v==submit)
		{	
			if(isCheckoutMode)
			{
				intent  = new Intent(PaymentDetailsCreditCard.this,OrderReceipt.class);
			}
			else
			{
				intent  = new Intent(PaymentDetailsCreditCard.this,ActionSelection.class);
				intent.putExtra("signed_in", true);
			}
			startActivity(intent);
		}
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.payment_details_cc);
		extras=getIntent().getExtras();
		if(extras!=null)
		{
			isCheckoutMode = extras.getBoolean("checkoutmode");
		}
		initialiseUI();
	}

	private void initialiseUI()
	{
		setHeading(R.string.credit_debit_card_details);
		setLeftButton();
		setRightButton();
		submit    = (TextView)findViewById(R.id.submit);
		submit.setOnClickListener(this);
	}

	/* (non-Javadoc)
	 * @see com.alkandros.linesmash.location.ILocationCallBack#setResult(java.lang.String)
	 */
	@Override
	public void setResult(String address) {
		// TODO Auto-generated method stub
		
	}
}
